package Task24;

public class Main {
    public static void main(String[] args) {
        int[][] array = new int[6][6];
        int sum = 0;
        for (int a = 0; a < array.length; a++) {
            for (int i = 0; i < array[a].length; i++) {
                array[a][i] = i;
            }
        }
    }
    public static int getMost(int[][] board) {
        // write code here
        int[][] max = new int[6][6];
        for (int i = 0; i < board.length; i++) {
            for (int j = 0; j < board[i].length; j++) {
                if (i == 0 && j == 0) {
                    max[i][j] = board[i][j];
                } else if (i == 0) {
                    max[i][j] = max[i][j - 1] + board[i][j];
                } else if (j == 0) {
                    max[i][j] = max[i - 1][j] + board[i][j];
                } else {
                    max[i][j] = Math.max( max[i - 1][j], max[i][j - 1]) + board[i][j];
                }
            }
        }
        return max[5][5];
    }
}
